package com.qst.controller;

import com.qst.dao.DepartmentDao;
import com.qst.dao.IEmployeeDao;
import com.qst.dao.MeetingDao;
import com.qst.pojo.Department;
import com.qst.pojo.Employee;
import com.qst.pojo.Meeting;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 用于进行方法的单元测试
 * @author Eumenides.
 * @create 2021-06-21 10:33
 */
@Controller
public class TestController {

    @Autowired
    private IEmployeeDao employeeDao;

    @Autowired
    private DepartmentDao departmentDao;

    @Autowired
    private MeetingDao meetingDao;

    @RequestMapping("/testFindAllEmployee")
    public void testFindAllEmployee() {
       List<Employee> employees = employeeDao.findAll();
       for(Employee e : employees) {
           System.out.println(e);
           System.out.println();
       }
    }

    @RequestMapping("/testFindAllDepartment")
    public void testFindAllDepartment() {
       List<Department> departments = departmentDao.findDep();
       for(Department e : departments) {
           System.out.println(e);
       }
    }

    @RequestMapping("/testInsertEmployee")
    public void testInsertEmployee() {
        Employee employee = new Employee();
        employeeDao.insertEmployee(employee);
    }


}
